// 引入vuex集中状态管理工具
import Vue from "vue"
import Vuex from "vuex"

// 引入home组件
import home from "./modules/home"
import search from "./modules/search"
// 引入detail组件
import detail from "./modules/detail"
import user from "./modules/user"
// 引入trade模块
import trade from "./modules/trade"
// 注册
Vue.use(Vuex)
// console.log(Vuex)
// 创建Vuex组件实例

const state = {
  // categoryList:[]
}
const actions = {}
const mutations = {}
const getters = {}
const store = new Vuex.Store({
  state,
  actions,
  mutations,
  getters,
  modules: { home, search, detail, user, trade },
})

// 暴露store
export default store
